|
dac24 2.2.0
|
API for configuring and manipulating DAC 24 Click driver. More...
Topics | |
| DAC 24 Registers List | |
| List of registers of DAC 24 Click driver. | |
| DAC 24 Registers Settings | |
| Settings for registers of DAC 24 Click driver. | |
| DAC 24 MikroBUS Map | |
| MikroBUS pin mapping of DAC 24 Click driver. | |
Functions | |
| void | dac24_cfg_setup (dac24_cfg_t *cfg) |
| DAC 24 configuration object setup function. | |
| err_t | dac24_init (dac24_t *ctx, dac24_cfg_t *cfg) |
| DAC 24 initialization function. | |
| err_t | dac24_write_reg (dac24_t *ctx, uint8_t reg, uint8_t data_in) |
| DAC 24 write register function. | |
| err_t | dac24_set_power_down (dac24_t *ctx, uint8_t pwr) |
| DAC 24 set power down function. | |
| err_t | dac24_set_dac_value (dac24_t *ctx, uint8_t channel, uint8_t value) |
| DAC 24 set DAC value function. | |
| err_t | dac24_set_dac_voltage (dac24_t *ctx, uint8_t channel, uint16_t voltage_mv) |
| DAC 24 set DAC voltage function. | |
API for configuring and manipulating DAC 24 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
| void dac24_cfg_setup | ( | dac24_cfg_t * | cfg | ) |
DAC 24 configuration object setup function.
This function initializes Click configuration structure to initial values.
| [out] | cfg | : Click configuration structure. See dac24_cfg_t object definition for detailed explanation. |
| err_t dac24_init | ( | dac24_t * | ctx, |
| dac24_cfg_t * | cfg ) |
DAC 24 initialization function.
This function initializes all necessary pins and peripherals used for this Click board.
| [out] | ctx | : Click context object. See dac24_t object definition for detailed explanation. |
| [in] | cfg | : Click configuration structure. See dac24_cfg_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t dac24_set_dac_value | ( | dac24_t * | ctx, |
| uint8_t | channel, | ||
| uint8_t | value ) |
DAC 24 set DAC value function.
This function writes the 8-bit DAC code value to one or more channels.
| [in] | ctx | : Click context object. See dac24_t object definition for detailed explanation. |
| [in] | channel | : DAC channels to be updated, see DAC24_CHANNEL_x macros. |
| [in] | value | : DAC code value (0 to DAC24_DAC_VALUE_MAX). |
0 - Success, -1 - Error (invalid channel argument). See #err_t definition for detailed explanation. | err_t dac24_set_dac_voltage | ( | dac24_t * | ctx, |
| uint8_t | channel, | ||
| uint16_t | voltage_mv ) |
DAC 24 set DAC voltage function.
This function sets the output voltage (in millivolts) for one or more channels by converting it to a corresponding DAC code and updating the device.
| [in] | ctx | : Click context object. See dac24_t object definition for detailed explanation. |
| [in] | channel | : DAC channels to be updated, see DAC24_CHANNEL_x macros. |
| [in] | voltage_mv | : Desired output voltage in millivolts. |
0 - Success, -1 - Error (voltage out of range). See #err_t definition for detailed explanation. | err_t dac24_set_power_down | ( | dac24_t * | ctx, |
| uint8_t | pwr ) |
DAC 24 set power down function.
This function sets the device in the selected power down mode.
| [in] | ctx | : Click context object. See dac24_t object definition for detailed explanation. |
| [in] | pwr | : Power down setting, see DAC24_POWER_DOWN_x macros. |
0 - Success, -1 - Error (invalid pwr argument). See #err_t definition for detailed explanation. | err_t dac24_write_reg | ( | dac24_t * | ctx, |
| uint8_t | reg, | ||
| uint8_t | data_in ) |
DAC 24 write register function.
This function writes a data byte to the selected register address.
| [in] | ctx | : Click context object. See dac24_t object definition for detailed explanation. |
| [in] | reg | : Register address. |
| [in] | data_in | : 8-bit data to be written. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation.